\(\int (a+b \arctan (c x)) (d+e \log (1+c^2 x^2)) \, dx\) [1290]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 100 \[ \int (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right ) \, dx=-2 a e x-2 b e x \arctan (c x)+\frac {e (a+b \arctan (c x))^2}{b c}+\frac {b e \log \left (1+c^2 x^2\right )}{c}+x (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right )-\frac {b \left (d+e \log \left (1+c^2 x^2\right )\right )^2}{4 c e} \]

[Out]

-2*a*e*x-2*b*e*x*arctan(c*x)+e*(a+b*arctan(c*x))^2/b/c+b*e*ln(c^2*x^2+1)/c+x*(a+b*arctan(c*x))*(d+e*ln(c^2*x^2
+1))-1/4*b*(d+e*ln(c^2*x^2+1))^2/c/e

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {5129, 2525, 2437, 2338, 5036, 4930, 266, 5004} \[ \int (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right ) \, dx=x (a+b \arctan (c x)) \left (e \log \left (c^2 x^2+1\right )+d\right )+\frac {e (a+b \arctan (c x))^2}{b c}-2 a e x-2 b e x \arctan (c x)-\frac {b \left (e \log \left (c^2 x^2+1\right )+d\right )^2}{4 c e}+\frac {b e \log \left (c^2 x^2+1\right )}{c} \]

[In]

Int[(a + b*ArcTan[c*x])*(d + e*Log[1 + c^2*x^2]),x]

[Out]

-2*a*e*x - 2*b*e*x*ArcTan[c*x] + (e*(a + b*ArcTan[c*x])^2)/(b*c) + (b*e*Log[1 + c^2*x^2])/c + x*(a + b*ArcTan[
c*x])*(d + e*Log[1 + c^2*x^2]) - (b*(d + e*Log[1 + c^2*x^2])^2)/(4*c*e)

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2437

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[(f*(x/d))^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2525

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(f + g*x^(s/n))^r*(a + b*Log[c*(d + e*x)^p])^q,
x], x, x^n], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q, r, s}, x] && IntegerQ[r] && IntegerQ[s/n] && Intege
rQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0])

Rule 4930

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x^n])^p, x] - Dist[b*c
*n*p, Int[x^n*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))), x], x] /; FreeQ[{a, b, c, n}, x] && IGtQ[p, 0
] && (EqQ[n, 1] || EqQ[p, 1])

Rule 5004

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5036

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2/
e, Int[(f*x)^(m - 2)*(a + b*ArcTan[c*x])^p, x], x] - Dist[d*(f^2/e), Int[(f*x)^(m - 2)*((a + b*ArcTan[c*x])^p/
(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rule 5129

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.)), x_Symbol] :> Simp[x*(d + e*L
og[f + g*x^2])*(a + b*ArcTan[c*x]), x] + (-Dist[b*c, Int[x*((d + e*Log[f + g*x^2])/(1 + c^2*x^2)), x], x] - Di
st[2*e*g, Int[x^2*((a + b*ArcTan[c*x])/(f + g*x^2)), x], x]) /; FreeQ[{a, b, c, d, e, f, g}, x]

Rubi steps \begin{align*} \text {integral}& = x (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right )-(b c) \int \frac {x \left (d+e \log \left (1+c^2 x^2\right )\right )}{1+c^2 x^2} \, dx-\left (2 c^2 e\right ) \int \frac {x^2 (a+b \arctan (c x))}{1+c^2 x^2} \, dx \\ & = x (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right )-\frac {1}{2} (b c) \text {Subst}\left (\int \frac {d+e \log \left (1+c^2 x\right )}{1+c^2 x} \, dx,x,x^2\right )-(2 e) \int (a+b \arctan (c x)) \, dx+(2 e) \int \frac {a+b \arctan (c x)}{1+c^2 x^2} \, dx \\ & = -2 a e x+\frac {e (a+b \arctan (c x))^2}{b c}+x (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right )-\frac {b \text {Subst}\left (\int \frac {d+e \log (x)}{x} \, dx,x,1+c^2 x^2\right )}{2 c}-(2 b e) \int \arctan (c x) \, dx \\ & = -2 a e x-2 b e x \arctan (c x)+\frac {e (a+b \arctan (c x))^2}{b c}+x (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right )-\frac {b \left (d+e \log \left (1+c^2 x^2\right )\right )^2}{4 c e}+(2 b c e) \int \frac {x}{1+c^2 x^2} \, dx \\ & = -2 a e x-2 b e x \arctan (c x)+\frac {e (a+b \arctan (c x))^2}{b c}+\frac {b e \log \left (1+c^2 x^2\right )}{c}+x (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right )-\frac {b \left (d+e \log \left (1+c^2 x^2\right )\right )^2}{4 c e} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.38 \[ \int (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right ) \, dx=a d x-2 a e x+\frac {2 a e \arctan (c x)}{c}+b d x \arctan (c x)-2 b e x \arctan (c x)+\frac {b e \arctan (c x)^2}{c}-\frac {b d \log \left (1+c^2 x^2\right )}{2 c}+\frac {b e \log \left (1+c^2 x^2\right )}{c}+a e x \log \left (1+c^2 x^2\right )+b e x \arctan (c x) \log \left (1+c^2 x^2\right )-\frac {b e \log ^2\left (1+c^2 x^2\right )}{4 c} \]

[In]

Integrate[(a + b*ArcTan[c*x])*(d + e*Log[1 + c^2*x^2]),x]

[Out]

a*d*x - 2*a*e*x + (2*a*e*ArcTan[c*x])/c + b*d*x*ArcTan[c*x] - 2*b*e*x*ArcTan[c*x] + (b*e*ArcTan[c*x]^2)/c - (b
*d*Log[1 + c^2*x^2])/(2*c) + (b*e*Log[1 + c^2*x^2])/c + a*e*x*Log[1 + c^2*x^2] + b*e*x*ArcTan[c*x]*Log[1 + c^2
*x^2] - (b*e*Log[1 + c^2*x^2]^2)/(4*c)

Maple [A] (verified)

Time = 1.14 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.37

method result size
parallelrisch \(\frac {4 e b \ln \left (c^{2} x^{2}+1\right ) x \arctan \left (c x \right ) c +4 b \arctan \left (c x \right ) x c d -8 e b \arctan \left (c x \right ) x c +4 e a \ln \left (c^{2} x^{2}+1\right ) x c +4 a c d x -8 x a c e +4 e b \arctan \left (c x \right )^{2}-e b \ln \left (c^{2} x^{2}+1\right )^{2}+8 e a \arctan \left (c x \right )-2 \ln \left (c^{2} x^{2}+1\right ) b d +4 \ln \left (c^{2} x^{2}+1\right ) b e}{4 c}\) \(137\)
default \(\text {Expression too large to display}\) \(2516\)
parts \(\text {Expression too large to display}\) \(2516\)
risch \(\text {Expression too large to display}\) \(22111\)

[In]

int((a+b*arctan(c*x))*(d+e*ln(c^2*x^2+1)),x,method=_RETURNVERBOSE)

[Out]

1/4*(4*e*b*ln(c^2*x^2+1)*x*arctan(c*x)*c+4*b*arctan(c*x)*x*c*d-8*e*b*arctan(c*x)*x*c+4*e*a*ln(c^2*x^2+1)*x*c+4
*a*c*d*x-8*x*a*c*e+4*e*b*arctan(c*x)^2-e*b*ln(c^2*x^2+1)^2+8*e*a*arctan(c*x)-2*ln(c^2*x^2+1)*b*d+4*ln(c^2*x^2+
1)*b*e)/c

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.05 \[ \int (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right ) \, dx=\frac {4 \, b e \arctan \left (c x\right )^{2} - b e \log \left (c^{2} x^{2} + 1\right )^{2} + 4 \, {\left (a c d - 2 \, a c e\right )} x + 4 \, {\left (2 \, a e + {\left (b c d - 2 \, b c e\right )} x\right )} \arctan \left (c x\right ) + 2 \, {\left (2 \, b c e x \arctan \left (c x\right ) + 2 \, a c e x - b d + 2 \, b e\right )} \log \left (c^{2} x^{2} + 1\right )}{4 \, c} \]

[In]

integrate((a+b*arctan(c*x))*(d+e*log(c^2*x^2+1)),x, algorithm="fricas")

[Out]

1/4*(4*b*e*arctan(c*x)^2 - b*e*log(c^2*x^2 + 1)^2 + 4*(a*c*d - 2*a*c*e)*x + 4*(2*a*e + (b*c*d - 2*b*c*e)*x)*ar
ctan(c*x) + 2*(2*b*c*e*x*arctan(c*x) + 2*a*c*e*x - b*d + 2*b*e)*log(c^2*x^2 + 1))/c

Sympy [A] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.48 \[ \int (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right ) \, dx=\begin {cases} a d x + a e x \log {\left (c^{2} x^{2} + 1 \right )} - 2 a e x + \frac {2 a e \operatorname {atan}{\left (c x \right )}}{c} + b d x \operatorname {atan}{\left (c x \right )} + b e x \log {\left (c^{2} x^{2} + 1 \right )} \operatorname {atan}{\left (c x \right )} - 2 b e x \operatorname {atan}{\left (c x \right )} - \frac {b d \log {\left (c^{2} x^{2} + 1 \right )}}{2 c} - \frac {b e \log {\left (c^{2} x^{2} + 1 \right )}^{2}}{4 c} + \frac {b e \log {\left (c^{2} x^{2} + 1 \right )}}{c} + \frac {b e \operatorname {atan}^{2}{\left (c x \right )}}{c} & \text {for}\: c \neq 0 \\a d x & \text {otherwise} \end {cases} \]

[In]

integrate((a+b*atan(c*x))*(d+e*ln(c**2*x**2+1)),x)

[Out]

Piecewise((a*d*x + a*e*x*log(c**2*x**2 + 1) - 2*a*e*x + 2*a*e*atan(c*x)/c + b*d*x*atan(c*x) + b*e*x*log(c**2*x
**2 + 1)*atan(c*x) - 2*b*e*x*atan(c*x) - b*d*log(c**2*x**2 + 1)/(2*c) - b*e*log(c**2*x**2 + 1)**2/(4*c) + b*e*
log(c**2*x**2 + 1)/c + b*e*atan(c*x)**2/c, Ne(c, 0)), (a*d*x, True))

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.53 \[ \int (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right ) \, dx=-{\left (2 \, c^{2} {\left (\frac {x}{c^{2}} - \frac {\arctan \left (c x\right )}{c^{3}}\right )} - x \log \left (c^{2} x^{2} + 1\right )\right )} b e \arctan \left (c x\right ) - {\left (2 \, c^{2} {\left (\frac {x}{c^{2}} - \frac {\arctan \left (c x\right )}{c^{3}}\right )} - x \log \left (c^{2} x^{2} + 1\right )\right )} a e + a d x + \frac {{\left (2 \, c x \arctan \left (c x\right ) - \log \left (c^{2} x^{2} + 1\right )\right )} b d}{2 \, c} - \frac {{\left (4 \, \arctan \left (c x\right )^{2} + \log \left (c^{2} x^{2} + 1\right )^{2} - 4 \, \log \left (c^{2} x^{2} + 1\right )\right )} b e}{4 \, c} \]

[In]

integrate((a+b*arctan(c*x))*(d+e*log(c^2*x^2+1)),x, algorithm="maxima")

[Out]

-(2*c^2*(x/c^2 - arctan(c*x)/c^3) - x*log(c^2*x^2 + 1))*b*e*arctan(c*x) - (2*c^2*(x/c^2 - arctan(c*x)/c^3) - x
*log(c^2*x^2 + 1))*a*e + a*d*x + 1/2*(2*c*x*arctan(c*x) - log(c^2*x^2 + 1))*b*d/c - 1/4*(4*arctan(c*x)^2 + log
(c^2*x^2 + 1)^2 - 4*log(c^2*x^2 + 1))*b*e/c

Giac [F]

\[ \int (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right ) \, dx=\int { {\left (b \arctan \left (c x\right ) + a\right )} {\left (e \log \left (c^{2} x^{2} + 1\right ) + d\right )} \,d x } \]

[In]

integrate((a+b*arctan(c*x))*(d+e*log(c^2*x^2+1)),x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 1.09 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.34 \[ \int (a+b \arctan (c x)) \left (d+e \log \left (1+c^2 x^2\right )\right ) \, dx=a\,d\,x-2\,a\,e\,x-\frac {b\,e\,{\ln \left (c^2\,x^2+1\right )}^2}{4\,c}+b\,d\,x\,\mathrm {atan}\left (c\,x\right )-2\,b\,e\,x\,\mathrm {atan}\left (c\,x\right )+a\,e\,x\,\ln \left (c^2\,x^2+1\right )+\frac {2\,a\,e\,\mathrm {atan}\left (c\,x\right )}{c}-\frac {b\,d\,\ln \left (c^2\,x^2+1\right )}{2\,c}+\frac {b\,e\,\ln \left (c^2\,x^2+1\right )}{c}+\frac {b\,e\,{\mathrm {atan}\left (c\,x\right )}^2}{c}+b\,e\,x\,\mathrm {atan}\left (c\,x\right )\,\ln \left (c^2\,x^2+1\right ) \]

[In]

int((a + b*atan(c*x))*(d + e*log(c^2*x^2 + 1)),x)

[Out]

a*d*x - 2*a*e*x - (b*e*log(c^2*x^2 + 1)^2)/(4*c) + b*d*x*atan(c*x) - 2*b*e*x*atan(c*x) + a*e*x*log(c^2*x^2 + 1
) + (2*a*e*atan(c*x))/c - (b*d*log(c^2*x^2 + 1))/(2*c) + (b*e*log(c^2*x^2 + 1))/c + (b*e*atan(c*x)^2)/c + b*e*
x*atan(c*x)*log(c^2*x^2 + 1)